package com.retail.report.controller;


import com.retail.core.entity.result.Result;
import com.retail.report.client.ReportClient;
import com.retail.report.entity.request.ResportRequest;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Api(value = "用户图表统计API", tags = "用户核销页面API")
@RestController
@RequestMapping("api/report")
public class ReportController {

    private final ReportClient reportClient;

    public ReportController(ReportClient reportClient) {
        this.reportClient = reportClient;
    }

    /**
     * 查询用户数据(订单数据)
     * @return
     */
    @PostMapping("statisticsReport")
    public Result<Map<String, Object>> statisticsReport(@RequestBody ResportRequest request){
        return reportClient.orderListReport(request);
    }


    /**
     * 查询用户数据(商户数据)
     * @return
     */
    @PostMapping("statisticsShopReport")
    public Result<Map<String, Object>> statisticsShopReport(@RequestBody ResportRequest request){
        return reportClient.statisticsShopReport(request);
    }

}
